<?php

/* Picasa helper file */

function newPicasaSession()
{
  $pic_session = new Picasa();
  $pic_session->authorizeWithClientLogin(sfConfig::get('app_picasa_username'), sfConfig::get('app_picasa_password'));
  return $pic_session;
}

function listAvailableAlbums()
{
  //List all albuns available online
  $pic = newPicasaSession();
  $account = $pic->getAlbumsByUsername(sfConfig::get('app_picasa_username'), null, null, 'all');
  $albums = $account->getAlbums();
  return $albums;
}

function loadAlbum($albumID)
{
  //Get album data online
  $pic = newPicasaSession();
  return $pic->getAlbumById(sfConfig::get('app_picasa_username'), $albumID); //, null, null, null, null, $thumbSize);
}

